from __future__ import print_function
import grpc
import sys
sys.path.append('../proto')

import llm_pb2
import llm_pb2_grpc

def run():

    print("client请求")
    channel = grpc.insecure_channel('192.168.3.7:50051')
    stub = llm_pb2_grpc.LLMChatApiStub(channel)
    response = stub.Ping(llm_pb2.PingRequest())
    print("gRPC ping received msg: ", response.msg)

    response = stub.GetLlmAnswer(llm_pb2.LlmRequest(question="西红柿能生吃吗?",llm_type="wennxin-turbo"))
    print("gRPC GetLlmAnswer received msg: ", response.answer)



if __name__ == '__main__':
    run()